//
//  KKHUD.m
//  PhnixHome
//
//  Created by Levy Xu on 2018/1/2.
//  Copyright © 2018年 Levy Xu. All rights reserved.
//

#import "KKHUD.h"

#define kHUDHidenTime 2.0

@implementation KKHUD

+(QMUITips *)createHUD {
    QMUIToastView *toast = [QMUIToastView toastInView:KEY_WINDOW];
    if (toast && [toast isKindOfClass:[QMUITips class]]) {
        return (QMUITips *)toast;
    } else {
        return [QMUITips createTipsToView:KEY_WINDOW];
    }
}

+(void)hide {
    [[KKHUD createHUD] hideAnimated:YES];
}

+(void)showWithText:(NSString *)text {
    [[KKHUD createHUD] showWithText:text hideAfterDelay:kHUDHidenTime];
}

+(void)showLoading:(NSString *)text {
    [[KKHUD createHUD] showLoading:text];
}

+(void)showSucceed:(NSString *)text {
    [[KKHUD createHUD] showSucceed:text hideAfterDelay:kHUDHidenTime];
}

+(void)showError:(NSString *)text {
    [[KKHUD createHUD] showError:text hideAfterDelay:kHUDHidenTime];
}

+(void)showInfo:(NSString *)text {
    [[KKHUD createHUD] showInfo:text hideAfterDelay:kHUDHidenTime];
}

@end
